package com.squirrel.common.response.code;

/**
 * @Description
 * @Author 关远键
 * @Version v1.0.0
 * @Date 2021/11/9 14:22
 */
public enum CodeEnum implements IEnum {
    // 登陆
    LOGIN_SUCCESS(200, "登录成功"),
    LOGIN_FAIL(201, "密码错误"),
    NOT_EXISTS(202, "手机号或邮箱不存在"),
    LOGIN_MAIL_FAIL(201, "验证码错误"),
    NON_PASSWORD(202, "该手机号还没有设置密码哦~"),

    // 注册
    REGISTER_SUCCESS(200, "注册成功"),
    REGISTER_EXISTS(201, "手机号或邮箱已注册"),
    REGISTER_FAIL(210, "注册失败"),

    //验证码
    MAIL_NOT_EXISTS(210, "邮箱地址无效"),
    MAIL_ERROR(210, "邮箱地址无效"),
    PHONE_ERROR(210, "无效的手机号"),

    //修改
    MODIFY_SUCCESS(200, "修改成功"),
    MODIFY_FAIL(201, "修改失败"),

    SUCCESS(200, "操作成功"),
    ERROR(400, "操作失败"),

    //无效的资源
    NON_RESOURCE(201, "这里还没有资源哦~"),
    INVALID_RESOURCE(404, "哈哈悲剧了吧~"),

    NO_AUTHORITY(401, "权限不足"),

    DB_EXCEPTION(400, "系统繁忙，请稍后重试。"),

    PARAM_ERROR(400, "参数错误"),

    FAIL(500, "内部错误"),


    /**
     * 登陆授权异常
     **/
    AUTHENTICATION_EXCEPTION(5104, "登陆授权异常"),
    /**
     * 没有访问权限
     **/
    UNAUTHENTICATED_EXCEPTION(5105, "没有访问权限"),
    /**
     * 没有访问权限
     **/
    UNAUTHORIZED_EXCEPTION(5106, "没有访问权限"),

    /**
     * token过期
     */
    PERMISSION_TOKEN_EXPIRED(5107, "登陆已过期"),
    /**
     * token解析异常
     */
    PERMISSION_TOKEN_INVALID(5108, "token解析异常"),
    /**
     * 签名失败
     */
    PERMISSION_SIGNATURE_ERROR(5109, "签名失败"),
    /**
     * 弹幕发送成功
     */
    GET_DANMU_SUCCESS(1, "弹幕发送成功");


    private Integer code;
    private String message;

    CodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
